﻿//07.Write a program that replaces all occurrences of the substring "start" with the substring "finish" in a text file. Ensure it will work with large files (e.g. 100 MB).

using System;
using System.IO;
using System.Text;

namespace ReplaceStrart
{
    class ReplaceStart
    {
        static void Main()
        {
            StreamReader reader = new StreamReader("replace.txt");
            StreamWriter writer = new StreamWriter("new.txt");

            string line = reader.ReadLine();

            while (line != null)
            {
                writer.WriteLine(line.Replace("start", "finish"));
                line = reader.ReadLine();
            }

            reader.Dispose();
            writer.Dispose();    
        }
    }
}
